{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Time series"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from __future__ import division\n",
    "from pandas import Series, DataFrame\n",
    "import pandas as pd\n",
    "from numpy.random import randn\n",
    "import numpy as np\n",
    "pd.options.display.max_rows = 12\n",
    "np.set_printoptions(precision=4, suppress=True)\n",
    "import matplotlib.pyplot as plt\n",
    "plt.rc('figure', figsize=(12, 4))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Date and Time Data Types and Tools"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.datetime(2021, 5, 12, 1, 31, 4, 871097)"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from datetime import datetime\n",
    "now = datetime.now()\n",
    "now"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(2021, 5, 12)"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "now.year, now.month, now.day"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.timedelta(days=926, seconds=56700)"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "delta = datetime(2011, 1, 7) - datetime(2008, 6, 24, 8, 15)\n",
    "delta"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "926"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "delta.days"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "56700"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "delta.seconds"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.datetime(2011, 1, 19, 0, 0)"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from datetime import timedelta\n",
    "start = datetime(2011, 1, 7)\n",
    "start + timedelta(12)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.datetime(2010, 12, 14, 0, 0)"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "start - 2 * timedelta(12)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Converting between string and datetime"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "stamp = datetime(2011, 1, 3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'2011-01-03 00:00:00'"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "str(stamp)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'2011-01-03'"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stamp.strftime('%Y-%m-%d')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.datetime(2011, 1, 3, 0, 0)"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "value = '2011-01-03'\n",
    "datetime.strptime(value, '%Y-%m-%d')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[datetime.datetime(2011, 7, 6, 0, 0), datetime.datetime(2011, 8, 6, 0, 0)]"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "datestrs = ['7/6/2011', '8/6/2011']\n",
    "[datetime.strptime(x, '%m/%d/%Y') for x in datestrs]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.datetime(2011, 1, 3, 0, 0)"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from dateutil.parser import parse\n",
    "parse('2011-01-03')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.datetime(1997, 1, 31, 22, 45)"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "parse('Jan 31, 1997 10:45 PM')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.datetime(2011, 12, 6, 0, 0)"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "parse('6/12/2011', dayfirst=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['7/6/2011', '8/6/2011']"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "datestrs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DatetimeIndex(['2011-07-06', '2011-08-06'], dtype='datetime64[ns]', freq=None)"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.to_datetime(datestrs)\n",
    "# note: output changed (no '00:00:00' anymore)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DatetimeIndex(['2011-07-06', '2011-08-06', 'NaT'], dtype='datetime64[ns]', freq=None)"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "idx = pd.to_datetime(datestrs + [None])\n",
    "idx"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "NaT"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "idx[2]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([False, False,  True])"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.isnull(idx)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Time Series Basics"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2011-01-02    0.358135\n",
       "2011-01-05   -1.023725\n",
       "2011-01-07   -0.207904\n",
       "2011-01-08   -1.229270\n",
       "2011-01-10   -0.435099\n",
       "2011-01-12   -0.696324\n",
       "dtype: float64"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from datetime import datetime\n",
    "dates = [datetime(2011, 1, 2), datetime(2011, 1, 5), datetime(2011, 1, 7),\n",
    "         datetime(2011, 1, 8), datetime(2011, 1, 10), datetime(2011, 1, 12)]\n",
    "ts = Series(np.random.randn(6), index=dates)\n",
    "ts"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "pandas.core.series.Series"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(ts)\n",
    "# note: output changed to \"pandas.core.series.Series\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DatetimeIndex(['2011-01-02', '2011-01-05', '2011-01-07', '2011-01-08',\n",
       "               '2011-01-10', '2011-01-12'],\n",
       "              dtype='datetime64[ns]', freq=None)"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts.index"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2011-01-02    0.716269\n",
       "2011-01-05         NaN\n",
       "2011-01-07   -0.415809\n",
       "2011-01-08         NaN\n",
       "2011-01-10   -0.870199\n",
       "2011-01-12         NaN\n",
       "dtype: float64"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts + ts[::2]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "dtype('<M8[ns]')"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts.index.dtype\n",
    "# note: output changed from dtype('datetime64[ns]') to dtype('<M8[ns]')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Timestamp('2011-01-02 00:00:00')"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stamp = ts.index[0]\n",
    "stamp\n",
    "# note: output changed from <Timestamp: 2011-01-02 00:00:00> to Timestamp('2011-01-02 00:00:00')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Indexing, selection, subsetting"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "-0.2079043768185998"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stamp = ts.index[2]\n",
    "ts[stamp]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "-0.43509928266694603"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts['1/10/2011']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "-0.43509928266694603"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts['20110110']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2000-01-01   -0.904066\n",
       "2000-01-02   -0.078012\n",
       "2000-01-03    3.298674\n",
       "2000-01-04   -1.662861\n",
       "2000-01-05    0.025442\n",
       "2000-01-06    0.199056\n",
       "                ...   \n",
       "2002-09-21    0.077433\n",
       "2002-09-22    1.883780\n",
       "2002-09-23   -1.036980\n",
       "2002-09-24   -0.353402\n",
       "2002-09-25    1.779372\n",
       "2002-09-26    2.009838\n",
       "Freq: D, Length: 1000, dtype: float64"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "longer_ts = Series(np.random.randn(1000),\n",
    "                   index=pd.date_range('1/1/2000', periods=1000))\n",
    "longer_ts"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2001-01-01    1.087261\n",
       "2001-01-02    0.914671\n",
       "2001-01-03    0.331851\n",
       "2001-01-04    0.052565\n",
       "2001-01-05   -1.766690\n",
       "2001-01-06   -0.271115\n",
       "                ...   \n",
       "2001-12-26    0.721023\n",
       "2001-12-27   -1.039878\n",
       "2001-12-28    0.161354\n",
       "2001-12-29    0.016183\n",
       "2001-12-30    1.048992\n",
       "2001-12-31   -0.466437\n",
       "Freq: D, Length: 365, dtype: float64"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "longer_ts['2001']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2001-05-01   -0.748962\n",
       "2001-05-02   -0.793354\n",
       "2001-05-03    1.087023\n",
       "2001-05-04    0.054766\n",
       "2001-05-05    0.372006\n",
       "2001-05-06    1.935647\n",
       "                ...   \n",
       "2001-05-26   -0.380468\n",
       "2001-05-27    0.873681\n",
       "2001-05-28    0.730465\n",
       "2001-05-29    0.511458\n",
       "2001-05-30   -0.975494\n",
       "2001-05-31    0.748090\n",
       "Freq: D, Length: 31, dtype: float64"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "longer_ts['2001-05']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2011-01-07   -0.207904\n",
       "2011-01-08   -1.229270\n",
       "2011-01-10   -0.435099\n",
       "2011-01-12   -0.696324\n",
       "dtype: float64"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts[datetime(2011, 1, 7):]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2011-01-02    0.358135\n",
       "2011-01-05   -1.023725\n",
       "2011-01-07   -0.207904\n",
       "2011-01-08   -1.229270\n",
       "2011-01-10   -0.435099\n",
       "2011-01-12   -0.696324\n",
       "dtype: float64"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2011-01-07   -0.207904\n",
       "2011-01-08   -1.229270\n",
       "2011-01-10   -0.435099\n",
       "dtype: float64"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts['1/6/2011':'1/11/2011']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2011-01-02    0.358135\n",
       "2011-01-05   -1.023725\n",
       "2011-01-07   -0.207904\n",
       "2011-01-08   -1.229270\n",
       "dtype: float64"
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts.truncate(after='1/9/2011')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "d:\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:5: DeprecationWarning: \n",
      ".ix is deprecated. Please use\n",
      ".loc for label based indexing or\n",
      ".iloc for positional indexing\n",
      "\n",
      "See the documentation here:\n",
      "http://pandas.pydata.org/pandas-docs/stable/indexing.html#ix-indexer-is-deprecated\n",
      "  \"\"\"\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Colorado</th>\n",
       "      <th>Texas</th>\n",
       "      <th>New York</th>\n",
       "      <th>Ohio</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2001-05-02</th>\n",
       "      <td>-0.861511</td>\n",
       "      <td>0.158782</td>\n",
       "      <td>-0.924849</td>\n",
       "      <td>0.045668</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2001-05-09</th>\n",
       "      <td>-2.117169</td>\n",
       "      <td>0.251164</td>\n",
       "      <td>-2.462260</td>\n",
       "      <td>1.484714</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2001-05-16</th>\n",
       "      <td>0.295925</td>\n",
       "      <td>0.558881</td>\n",
       "      <td>-0.332620</td>\n",
       "      <td>1.278301</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2001-05-23</th>\n",
       "      <td>-0.969984</td>\n",
       "      <td>0.588215</td>\n",
       "      <td>-0.051807</td>\n",
       "      <td>-0.913774</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2001-05-30</th>\n",
       "      <td>-0.690621</td>\n",
       "      <td>-0.046995</td>\n",
       "      <td>-0.890063</td>\n",
       "      <td>-1.145925</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "            Colorado     Texas  New York      Ohio\n",
       "2001-05-02 -0.861511  0.158782 -0.924849  0.045668\n",
       "2001-05-09 -2.117169  0.251164 -2.462260  1.484714\n",
       "2001-05-16  0.295925  0.558881 -0.332620  1.278301\n",
       "2001-05-23 -0.969984  0.588215 -0.051807 -0.913774\n",
       "2001-05-30 -0.690621 -0.046995 -0.890063 -1.145925"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dates = pd.date_range('1/1/2000', periods=100, freq='W-WED')\n",
    "long_df = DataFrame(np.random.randn(100, 4),\n",
    "                    index=dates,\n",
    "                    columns=['Colorado', 'Texas', 'New York', 'Ohio'])\n",
    "long_df.ix['5-2001']"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Time series with duplicate indices"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2000-01-01    0\n",
       "2000-01-02    1\n",
       "2000-01-02    2\n",
       "2000-01-02    3\n",
       "2000-01-03    4\n",
       "dtype: int32"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dates = pd.DatetimeIndex(['1/1/2000', '1/2/2000', '1/2/2000', '1/2/2000',\n",
    "                          '1/3/2000'])\n",
    "dup_ts = Series(np.arange(5), index=dates)\n",
    "dup_ts"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "False"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dup_ts.index.is_unique"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "4"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dup_ts['1/3/2000']  # not duplicated"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2000-01-02    1\n",
       "2000-01-02    2\n",
       "2000-01-02    3\n",
       "dtype: int32"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dup_ts['1/2/2000']  # duplicated"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2000-01-01    0\n",
       "2000-01-02    2\n",
       "2000-01-03    4\n",
       "dtype: int32"
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "grouped = dup_ts.groupby(level=0)\n",
    "grouped.mean()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2000-01-01    1\n",
       "2000-01-02    3\n",
       "2000-01-03    1\n",
       "dtype: int64"
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "grouped.count()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Date ranges, Frequencies, and Shifting"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2011-01-02    0.358135\n",
       "2011-01-05   -1.023725\n",
       "2011-01-07   -0.207904\n",
       "2011-01-08   -1.229270\n",
       "2011-01-10   -0.435099\n",
       "2011-01-12   -0.696324\n",
       "dtype: float64"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DatetimeIndexResampler [freq=<Day>, axis=0, closed=left, label=left, convention=start, base=0]"
      ]
     },
     "execution_count": 47,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts.resample('D')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Generating date ranges"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DatetimeIndex(['2012-04-01', '2012-04-02', '2012-04-03', '2012-04-04',\n",
       "               '2012-04-05', '2012-04-06', '2012-04-07', '2012-04-08',\n",
       "               '2012-04-09', '2012-04-10', '2012-04-11', '2012-04-12',\n",
       "               '2012-04-13', '2012-04-14', '2012-04-15', '2012-04-16',\n",
       "               '2012-04-17', '2012-04-18', '2012-04-19', '2012-04-20',\n",
       "               '2012-04-21', '2012-04-22', '2012-04-23', '2012-04-24',\n",
       "               '2012-04-25', '2012-04-26', '2012-04-27', '2012-04-28',\n",
       "               '2012-04-29', '2012-04-30', '2012-05-01', '2012-05-02',\n",
       "               '2012-05-03', '2012-05-04', '2012-05-05', '2012-05-06',\n",
       "               '2012-05-07', '2012-05-08', '2012-05-09', '2012-05-10',\n",
       "               '2012-05-11', '2012-05-12', '2012-05-13', '2012-05-14',\n",
       "               '2012-05-15', '2012-05-16', '2012-05-17', '2012-05-18',\n",
       "               '2012-05-19', '2012-05-20', '2012-05-21', '2012-05-22',\n",
       "               '2012-05-23', '2012-05-24', '2012-05-25', '2012-05-26',\n",
       "               '2012-05-27', '2012-05-28', '2012-05-29', '2012-05-30',\n",
       "               '2012-05-31', '2012-06-01'],\n",
       "              dtype='datetime64[ns]', freq='D')"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "index = pd.date_range('4/1/2012', '6/1/2012')\n",
    "index"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DatetimeIndex(['2012-04-01', '2012-04-02', '2012-04-03', '2012-04-04',\n",
       "               '2012-04-05', '2012-04-06', '2012-04-07', '2012-04-08',\n",
       "               '2012-04-09', '2012-04-10', '2012-04-11', '2012-04-12',\n",
       "               '2012-04-13', '2012-04-14', '2012-04-15', '2012-04-16',\n",
       "               '2012-04-17', '2012-04-18', '2012-04-19', '2012-04-20'],\n",
       "              dtype='datetime64[ns]', freq='D')"
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.date_range(start='4/1/2012', periods=20)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DatetimeIndex(['2012-05-13', '2012-05-14', '2012-05-15', '2012-05-16',\n",
       "               '2012-05-17', '2012-05-18', '2012-05-19', '2012-05-20',\n",
       "               '2012-05-21', '2012-05-22', '2012-05-23', '2012-05-24',\n",
       "               '2012-05-25', '2012-05-26', '2012-05-27', '2012-05-28',\n",
       "               '2012-05-29', '2012-05-30', '2012-05-31', '2012-06-01'],\n",
       "              dtype='datetime64[ns]', freq='D')"
      ]
     },
     "execution_count": 50,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.date_range(end='6/1/2012', periods=20)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DatetimeIndex(['2000-01-31', '2000-02-29', '2000-03-31', '2000-04-28',\n",
       "               '2000-05-31', '2000-06-30', '2000-07-31', '2000-08-31',\n",
       "               '2000-09-29', '2000-10-31', '2000-11-30'],\n",
       "              dtype='datetime64[ns]', freq='BM')"
      ]
     },
     "execution_count": 51,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.date_range('1/1/2000', '12/1/2000', freq='BM')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DatetimeIndex(['2012-05-02 12:56:31', '2012-05-03 12:56:31',\n",
       "               '2012-05-04 12:56:31', '2012-05-05 12:56:31',\n",
       "               '2012-05-06 12:56:31'],\n",
       "              dtype='datetime64[ns]', freq='D')"
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.date_range('5/2/2012 12:56:31', periods=5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DatetimeIndex(['2012-05-02', '2012-05-03', '2012-05-04', '2012-05-05',\n",
       "               '2012-05-06'],\n",
       "              dtype='datetime64[ns]', freq='D')"
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.date_range('5/2/2012 12:56:31', periods=5, normalize=True)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Frequencies and Date Offsets"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Hour>"
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pandas.tseries.offsets import Hour, Minute\n",
    "hour = Hour()\n",
    "hour"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<4 * Hours>"
      ]
     },
     "execution_count": 55,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "four_hours = Hour(4)\n",
    "four_hours"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DatetimeIndex(['2000-01-01 00:00:00', '2000-01-01 04:00:00',\n",
       "               '2000-01-01 08:00:00', '2000-01-01 12:00:00',\n",
       "               '2000-01-01 16:00:00', '2000-01-01 20:00:00',\n",
       "               '2000-01-02 00:00:00', '2000-01-02 04:00:00',\n",
       "               '2000-01-02 08:00:00', '2000-01-02 12:00:00',\n",
       "               '2000-01-02 16:00:00', '2000-01-02 20:00:00',\n",
       "               '2000-01-03 00:00:00', '2000-01-03 04:00:00',\n",
       "               '2000-01-03 08:00:00', '2000-01-03 12:00:00',\n",
       "               '2000-01-03 16:00:00', '2000-01-03 20:00:00'],\n",
       "              dtype='datetime64[ns]', freq='4H')"
      ]
     },
     "execution_count": 56,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.date_range('1/1/2000', '1/3/2000 23:59', freq='4h')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<150 * Minutes>"
      ]
     },
     "execution_count": 57,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Hour(2) + Minute(30)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DatetimeIndex(['2000-01-01 00:00:00', '2000-01-01 01:30:00',\n",
       "               '2000-01-01 03:00:00', '2000-01-01 04:30:00',\n",
       "               '2000-01-01 06:00:00', '2000-01-01 07:30:00',\n",
       "               '2000-01-01 09:00:00', '2000-01-01 10:30:00',\n",
       "               '2000-01-01 12:00:00', '2000-01-01 13:30:00'],\n",
       "              dtype='datetime64[ns]', freq='90T')"
      ]
     },
     "execution_count": 58,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.date_range('1/1/2000', periods=10, freq='1h30min')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Week of month dates"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[Timestamp('2012-01-20 00:00:00', freq='WOM-3FRI'),\n",
       " Timestamp('2012-02-17 00:00:00', freq='WOM-3FRI'),\n",
       " Timestamp('2012-03-16 00:00:00', freq='WOM-3FRI'),\n",
       " Timestamp('2012-04-20 00:00:00', freq='WOM-3FRI'),\n",
       " Timestamp('2012-05-18 00:00:00', freq='WOM-3FRI'),\n",
       " Timestamp('2012-06-15 00:00:00', freq='WOM-3FRI'),\n",
       " Timestamp('2012-07-20 00:00:00', freq='WOM-3FRI'),\n",
       " Timestamp('2012-08-17 00:00:00', freq='WOM-3FRI')]"
      ]
     },
     "execution_count": 59,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "rng = pd.date_range('1/1/2012', '9/1/2012', freq='WOM-3FRI')\n",
    "list(rng)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Shifting (leading and lagging) data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2000-01-31    0.320669\n",
       "2000-02-29   -0.491430\n",
       "2000-03-31   -0.464311\n",
       "2000-04-30    1.154628\n",
       "Freq: M, dtype: float64"
      ]
     },
     "execution_count": 60,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts = Series(np.random.randn(4),\n",
    "            index=pd.date_range('1/1/2000', periods=4, freq='M'))\n",
    "ts"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2000-01-31         NaN\n",
       "2000-02-29         NaN\n",
       "2000-03-31    0.320669\n",
       "2000-04-30   -0.491430\n",
       "Freq: M, dtype: float64"
      ]
     },
     "execution_count": 61,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts.shift(2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2000-01-31   -0.464311\n",
       "2000-02-29    1.154628\n",
       "2000-03-31         NaN\n",
       "2000-04-30         NaN\n",
       "Freq: M, dtype: float64"
      ]
     },
     "execution_count": 62,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts.shift(-2)"
   ]
  },
  {
   "cell_type": "raw",
   "metadata": {},
   "source": [
    "ts / ts.shift(1) - 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2000-03-31    0.320669\n",
       "2000-04-30   -0.491430\n",
       "2000-05-31   -0.464311\n",
       "2000-06-30    1.154628\n",
       "Freq: M, dtype: float64"
      ]
     },
     "execution_count": 63,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts.shift(2, freq='M')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2000-02-03    0.320669\n",
       "2000-03-03   -0.491430\n",
       "2000-04-03   -0.464311\n",
       "2000-05-03    1.154628\n",
       "dtype: float64"
      ]
     },
     "execution_count": 64,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts.shift(3, freq='D')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2000-02-03    0.320669\n",
       "2000-03-03   -0.491430\n",
       "2000-04-03   -0.464311\n",
       "2000-05-03    1.154628\n",
       "dtype: float64"
      ]
     },
     "execution_count": 65,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts.shift(1, freq='3D')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2000-01-31 01:30:00    0.320669\n",
       "2000-02-29 01:30:00   -0.491430\n",
       "2000-03-31 01:30:00   -0.464311\n",
       "2000-04-30 01:30:00    1.154628\n",
       "Freq: M, dtype: float64"
      ]
     },
     "execution_count": 66,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts.shift(1, freq='90T')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Shifting dates with offsets"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Timestamp('2011-11-20 00:00:00')"
      ]
     },
     "execution_count": 67,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pandas.tseries.offsets import Day, MonthEnd\n",
    "now = datetime(2011, 11, 17)\n",
    "now + 3 * Day()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Timestamp('2011-11-30 00:00:00')"
      ]
     },
     "execution_count": 68,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "now + MonthEnd()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 69,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Timestamp('2011-12-31 00:00:00')"
      ]
     },
     "execution_count": 69,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "now + MonthEnd(2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Timestamp('2011-11-30 00:00:00')"
      ]
     },
     "execution_count": 70,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "offset = MonthEnd()\n",
    "offset.rollforward(now)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 71,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Timestamp('2011-10-31 00:00:00')"
      ]
     },
     "execution_count": 71,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "offset.rollback(now)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 72,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2000-01-31    0.412266\n",
       "2000-02-29    0.121265\n",
       "2000-03-31   -0.075787\n",
       "dtype: float64"
      ]
     },
     "execution_count": 72,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts = Series(np.random.randn(20),\n",
    "            index=pd.date_range('1/15/2000', periods=20, freq='4d'))\n",
    "ts.groupby(offset.rollforward).mean()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "d:\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:1: FutureWarning: how in .resample() is deprecated\n",
      "the new syntax is .resample(...).mean()\n",
      "  \"\"\"Entry point for launching an IPython kernel.\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "2000-01-31    0.412266\n",
       "2000-02-29    0.121265\n",
       "2000-03-31   -0.075787\n",
       "Freq: M, dtype: float64"
      ]
     },
     "execution_count": 73,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts.resample('M', how='mean')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Time Zone Handling"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['US/Eastern', 'US/Hawaii', 'US/Mountain', 'US/Pacific', 'UTC']"
      ]
     },
     "execution_count": 74,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pytz\n",
    "pytz.common_timezones[-5:]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 75,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<DstTzInfo 'US/Eastern' LMT-1 day, 19:04:00 STD>"
      ]
     },
     "execution_count": 75,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tz = pytz.timezone('US/Eastern')\n",
    "tz"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Localization and Conversion"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "metadata": {},
   "outputs": [],
   "source": [
    "rng = pd.date_range('3/9/2012 9:30', periods=6, freq='D')\n",
    "ts = Series(np.random.randn(len(rng)), index=rng)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "None\n"
     ]
    }
   ],
   "source": [
    "print(ts.index.tz)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DatetimeIndex(['2012-03-09 09:30:00+00:00', '2012-03-10 09:30:00+00:00',\n",
       "               '2012-03-11 09:30:00+00:00', '2012-03-12 09:30:00+00:00',\n",
       "               '2012-03-13 09:30:00+00:00', '2012-03-14 09:30:00+00:00',\n",
       "               '2012-03-15 09:30:00+00:00', '2012-03-16 09:30:00+00:00',\n",
       "               '2012-03-17 09:30:00+00:00', '2012-03-18 09:30:00+00:00'],\n",
       "              dtype='datetime64[ns, UTC]', freq='D')"
      ]
     },
     "execution_count": 78,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.date_range('3/9/2012 9:30', periods=10, freq='D', tz='UTC')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2012-03-09 09:30:00+00:00    0.835701\n",
       "2012-03-10 09:30:00+00:00    0.024270\n",
       "2012-03-11 09:30:00+00:00    0.513816\n",
       "2012-03-12 09:30:00+00:00    0.695143\n",
       "2012-03-13 09:30:00+00:00   -1.372739\n",
       "2012-03-14 09:30:00+00:00    0.288015\n",
       "Freq: D, dtype: float64"
      ]
     },
     "execution_count": 79,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts_utc = ts.tz_localize('UTC')\n",
    "ts_utc"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DatetimeIndex(['2012-03-09 09:30:00+00:00', '2012-03-10 09:30:00+00:00',\n",
       "               '2012-03-11 09:30:00+00:00', '2012-03-12 09:30:00+00:00',\n",
       "               '2012-03-13 09:30:00+00:00', '2012-03-14 09:30:00+00:00'],\n",
       "              dtype='datetime64[ns, UTC]', freq='D')"
      ]
     },
     "execution_count": 80,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts_utc.index"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2012-03-09 04:30:00-05:00    0.835701\n",
       "2012-03-10 04:30:00-05:00    0.024270\n",
       "2012-03-11 05:30:00-04:00    0.513816\n",
       "2012-03-12 05:30:00-04:00    0.695143\n",
       "2012-03-13 05:30:00-04:00   -1.372739\n",
       "2012-03-14 05:30:00-04:00    0.288015\n",
       "Freq: D, dtype: float64"
      ]
     },
     "execution_count": 81,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts_utc.tz_convert('US/Eastern')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 82,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2012-03-09 14:30:00+00:00    0.835701\n",
       "2012-03-10 14:30:00+00:00    0.024270\n",
       "2012-03-11 13:30:00+00:00    0.513816\n",
       "2012-03-12 13:30:00+00:00    0.695143\n",
       "2012-03-13 13:30:00+00:00   -1.372739\n",
       "2012-03-14 13:30:00+00:00    0.288015\n",
       "Freq: D, dtype: float64"
      ]
     },
     "execution_count": 82,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts_eastern = ts.tz_localize('US/Eastern')\n",
    "ts_eastern.tz_convert('UTC')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 83,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2012-03-09 15:30:00+01:00    0.835701\n",
       "2012-03-10 15:30:00+01:00    0.024270\n",
       "2012-03-11 14:30:00+01:00    0.513816\n",
       "2012-03-12 14:30:00+01:00    0.695143\n",
       "2012-03-13 14:30:00+01:00   -1.372739\n",
       "2012-03-14 14:30:00+01:00    0.288015\n",
       "Freq: D, dtype: float64"
      ]
     },
     "execution_count": 83,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts_eastern.tz_convert('Europe/Berlin')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 84,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DatetimeIndex(['2012-03-09 09:30:00+08:00', '2012-03-10 09:30:00+08:00',\n",
       "               '2012-03-11 09:30:00+08:00', '2012-03-12 09:30:00+08:00',\n",
       "               '2012-03-13 09:30:00+08:00', '2012-03-14 09:30:00+08:00'],\n",
       "              dtype='datetime64[ns, Asia/Shanghai]', freq='D')"
      ]
     },
     "execution_count": 84,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts.index.tz_localize('Asia/Shanghai')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Operations with time zone-aware Timestamp objects"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 85,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Timestamp('2011-03-11 23:00:00-0500', tz='US/Eastern')"
      ]
     },
     "execution_count": 85,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stamp = pd.Timestamp('2011-03-12 04:00')\n",
    "stamp_utc = stamp.tz_localize('utc')\n",
    "stamp_utc.tz_convert('US/Eastern')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 86,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Timestamp('2011-03-12 04:00:00+0300', tz='Europe/Moscow')"
      ]
     },
     "execution_count": 86,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stamp_moscow = pd.Timestamp('2011-03-12 04:00', tz='Europe/Moscow')\n",
    "stamp_moscow"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 87,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1299902400000000000"
      ]
     },
     "execution_count": 87,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stamp_utc.value"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1299902400000000000"
      ]
     },
     "execution_count": 88,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stamp_utc.tz_convert('US/Eastern').value"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 89,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Timestamp('2012-03-12 01:30:00-0400', tz='US/Eastern')"
      ]
     },
     "execution_count": 89,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 30 minutes before DST transition\n",
    "from pandas.tseries.offsets import Hour\n",
    "stamp = pd.Timestamp('2012-03-12 01:30', tz='US/Eastern')\n",
    "stamp"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 90,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Timestamp('2012-03-12 02:30:00-0400', tz='US/Eastern')"
      ]
     },
     "execution_count": 90,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stamp + Hour()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 91,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Timestamp('2012-11-04 00:30:00-0400', tz='US/Eastern')"
      ]
     },
     "execution_count": 91,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 90 minutes before DST transition\n",
    "stamp = pd.Timestamp('2012-11-04 00:30', tz='US/Eastern')\n",
    "stamp"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 92,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Timestamp('2012-11-04 01:30:00-0500', tz='US/Eastern')"
      ]
     },
     "execution_count": 92,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stamp + 2 * Hour()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Operations between different time zones"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 93,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2012-03-07 09:30:00    1.538779\n",
       "2012-03-08 09:30:00    1.161528\n",
       "2012-03-09 09:30:00   -2.354831\n",
       "2012-03-12 09:30:00   -1.032873\n",
       "2012-03-13 09:30:00   -0.136791\n",
       "2012-03-14 09:30:00    2.114720\n",
       "2012-03-15 09:30:00   -0.774407\n",
       "2012-03-16 09:30:00    0.828296\n",
       "2012-03-19 09:30:00    1.353674\n",
       "2012-03-20 09:30:00    0.244554\n",
       "Freq: B, dtype: float64"
      ]
     },
     "execution_count": 93,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "rng = pd.date_range('3/7/2012 9:30', periods=10, freq='B')\n",
    "ts = Series(np.random.randn(len(rng)), index=rng)\n",
    "ts"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 94,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DatetimeIndex(['2012-03-07 09:30:00+00:00', '2012-03-08 09:30:00+00:00',\n",
       "               '2012-03-09 09:30:00+00:00', '2012-03-12 09:30:00+00:00',\n",
       "               '2012-03-13 09:30:00+00:00', '2012-03-14 09:30:00+00:00',\n",
       "               '2012-03-15 09:30:00+00:00'],\n",
       "              dtype='datetime64[ns, UTC]', freq='B')"
      ]
     },
     "execution_count": 94,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts1 = ts[:7].tz_localize('Europe/London')\n",
    "ts2 = ts1[2:].tz_convert('Europe/Moscow')\n",
    "result = ts1 + ts2\n",
    "result.index"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Periods and Period Arithmetic"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 95,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Period('2007', 'A-DEC')"
      ]
     },
     "execution_count": 95,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "p = pd.Period(2007, freq='A-DEC')\n",
    "p"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 96,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Period('2012', 'A-DEC')"
      ]
     },
     "execution_count": 96,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "p + 5"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 97,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Period('2005', 'A-DEC')"
      ]
     },
     "execution_count": 97,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "p - 2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 98,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<7 * YearEnds: month=12>"
      ]
     },
     "execution_count": 98,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.Period('2014', freq='A-DEC') - p"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 99,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "PeriodIndex(['2000-01', '2000-02', '2000-03', '2000-04', '2000-05', '2000-06'], dtype='period[M]', freq='M')"
      ]
     },
     "execution_count": 99,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "rng = pd.period_range('1/1/2000', '6/30/2000', freq='M')\n",
    "rng"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 100,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2000-01   -1.659116\n",
       "2000-02    0.309206\n",
       "2000-03    0.059561\n",
       "2000-04    0.076707\n",
       "2000-05   -0.535264\n",
       "2000-06    0.911120\n",
       "Freq: M, dtype: float64"
      ]
     },
     "execution_count": 100,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Series(np.random.randn(6), index=rng)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 101,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "PeriodIndex(['2001Q3', '2002Q2', '2003Q1'], dtype='period[Q-DEC]', freq='Q-DEC')"
      ]
     },
     "execution_count": 101,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "values = ['2001Q3', '2002Q2', '2003Q1']\n",
    "index = pd.PeriodIndex(values, freq='Q-DEC')\n",
    "index"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Period Frequency Conversion"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 102,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Period('2007-01', 'M')"
      ]
     },
     "execution_count": 102,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "p = pd.Period('2007', freq='A-DEC')\n",
    "p.asfreq('M', how='start')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 103,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Period('2007-12', 'M')"
      ]
     },
     "execution_count": 103,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "p.asfreq('M', how='end')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 104,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Period('2006-07', 'M')"
      ]
     },
     "execution_count": 104,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "p = pd.Period('2007', freq='A-JUN')\n",
    "p.asfreq('M', 'start')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 105,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Period('2007-06', 'M')"
      ]
     },
     "execution_count": 105,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "p.asfreq('M', 'end')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 106,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Period('2008', 'A-JUN')"
      ]
     },
     "execution_count": 106,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "p = pd.Period('Aug-2007', 'M')\n",
    "p.asfreq('A-JUN')\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 107,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2006   -0.680821\n",
       "2007    0.233331\n",
       "2008   -0.926035\n",
       "2009   -0.204163\n",
       "Freq: A-DEC, dtype: float64"
      ]
     },
     "execution_count": 107,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "rng = pd.period_range('2006', '2009', freq='A-DEC')\n",
    "ts = Series(np.random.randn(len(rng)), index=rng)\n",
    "ts"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 108,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2006-01   -0.680821\n",
       "2007-01    0.233331\n",
       "2008-01   -0.926035\n",
       "2009-01   -0.204163\n",
       "Freq: M, dtype: float64"
      ]
     },
     "execution_count": 108,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts.asfreq('M', how='start')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 109,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2006-12-29   -0.680821\n",
       "2007-12-31    0.233331\n",
       "2008-12-31   -0.926035\n",
       "2009-12-31   -0.204163\n",
       "Freq: B, dtype: float64"
      ]
     },
     "execution_count": 109,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts.asfreq('B', how='end')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Quarterly period frequencies"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 110,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Period('2012Q4', 'Q-JAN')"
      ]
     },
     "execution_count": 110,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "p = pd.Period('2012Q4', freq='Q-JAN')\n",
    "p"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 111,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Period('2011-11-01', 'D')"
      ]
     },
     "execution_count": 111,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "p.asfreq('D', 'start')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 112,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Period('2012-01-31', 'D')"
      ]
     },
     "execution_count": 112,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "p.asfreq('D', 'end')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 113,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Period('2012-01-30 16:00', 'T')"
      ]
     },
     "execution_count": 113,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "p4pm = (p.asfreq('B', 'e') - 1).asfreq('T', 's') + 16 * 60\n",
    "p4pm"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 114,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Timestamp('2012-01-30 16:00:00')"
      ]
     },
     "execution_count": 114,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "p4pm.to_timestamp()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 115,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2011Q3    0\n",
       "2011Q4    1\n",
       "2012Q1    2\n",
       "2012Q2    3\n",
       "2012Q3    4\n",
       "2012Q4    5\n",
       "Freq: Q-JAN, dtype: int32"
      ]
     },
     "execution_count": 115,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "rng = pd.period_range('2011Q3', '2012Q4', freq='Q-JAN')\n",
    "ts = Series(np.arange(len(rng)), index=rng)\n",
    "ts"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 116,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2010-10-28 16:00:00    0\n",
       "2011-01-28 16:00:00    1\n",
       "2011-04-28 16:00:00    2\n",
       "2011-07-28 16:00:00    3\n",
       "2011-10-28 16:00:00    4\n",
       "2012-01-30 16:00:00    5\n",
       "dtype: int32"
      ]
     },
     "execution_count": 116,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "new_rng = (rng.asfreq('B', 'e') - 1).asfreq('T', 's') + 16 * 60\n",
    "ts.index = new_rng.to_timestamp()\n",
    "ts"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Converting Timestamps to Periods (and back)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 117,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2000-01-31   -1.380145\n",
       "2000-02-29    0.121530\n",
       "2000-03-31    0.346006\n",
       "Freq: M, dtype: float64"
      ]
     },
     "execution_count": 117,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "rng = pd.date_range('1/1/2000', periods=3, freq='M')\n",
    "ts = Series(randn(3), index=rng)\n",
    "pts = ts.to_period()\n",
    "ts"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 118,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2000-01   -1.380145\n",
       "2000-02    0.121530\n",
       "2000-03    0.346006\n",
       "Freq: M, dtype: float64"
      ]
     },
     "execution_count": 118,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pts"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 119,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2000-01   -0.879590\n",
       "2000-01    1.600008\n",
       "2000-01   -1.305909\n",
       "2000-02   -1.154252\n",
       "2000-02    0.353116\n",
       "2000-02    1.915330\n",
       "Freq: M, dtype: float64"
      ]
     },
     "execution_count": 119,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "rng = pd.date_range('1/29/2000', periods=6, freq='D')\n",
    "ts2 = Series(randn(6), index=rng)\n",
    "ts2.to_period('M')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 120,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2000-01   -1.380145\n",
       "2000-02    0.121530\n",
       "2000-03    0.346006\n",
       "Freq: M, dtype: float64"
      ]
     },
     "execution_count": 120,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pts = ts.to_period()\n",
    "pts"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 121,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2000-01-31 23:59:59.999999999   -1.380145\n",
       "2000-02-29 23:59:59.999999999    0.121530\n",
       "2000-03-31 23:59:59.999999999    0.346006\n",
       "Freq: M, dtype: float64"
      ]
     },
     "execution_count": 121,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pts.to_timestamp(how='end')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Creating a PeriodIndex from arrays"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 122,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0      1959.0\n",
       "1      1959.0\n",
       "2      1959.0\n",
       "3      1959.0\n",
       "4      1960.0\n",
       "5      1960.0\n",
       "        ...  \n",
       "197    2008.0\n",
       "198    2008.0\n",
       "199    2008.0\n",
       "200    2009.0\n",
       "201    2009.0\n",
       "202    2009.0\n",
       "Name: year, Length: 203, dtype: float64"
      ]
     },
     "execution_count": 122,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data = pd.read_csv('ch08/macrodata.csv')\n",
    "data.year"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 123,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0      1.0\n",
       "1      2.0\n",
       "2      3.0\n",
       "3      4.0\n",
       "4      1.0\n",
       "5      2.0\n",
       "      ... \n",
       "197    2.0\n",
       "198    3.0\n",
       "199    4.0\n",
       "200    1.0\n",
       "201    2.0\n",
       "202    3.0\n",
       "Name: quarter, Length: 203, dtype: float64"
      ]
     },
     "execution_count": 123,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.quarter"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 124,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "PeriodIndex(['1959Q1', '1959Q2', '1959Q3', '1959Q4', '1960Q1', '1960Q2',\n",
       "             '1960Q3', '1960Q4', '1961Q1', '1961Q2',\n",
       "             ...\n",
       "             '2007Q2', '2007Q3', '2007Q4', '2008Q1', '2008Q2', '2008Q3',\n",
       "             '2008Q4', '2009Q1', '2009Q2', '2009Q3'],\n",
       "            dtype='period[Q-DEC]', length=203, freq='Q-DEC')"
      ]
     },
     "execution_count": 124,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "index = pd.PeriodIndex(year=data.year, quarter=data.quarter, freq='Q-DEC')\n",
    "index"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 125,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1959Q1    0.00\n",
       "1959Q2    2.34\n",
       "1959Q3    2.74\n",
       "1959Q4    0.27\n",
       "1960Q1    2.31\n",
       "1960Q2    0.14\n",
       "          ... \n",
       "2008Q2    8.53\n",
       "2008Q3   -3.16\n",
       "2008Q4   -8.79\n",
       "2009Q1    0.94\n",
       "2009Q2    3.37\n",
       "2009Q3    3.56\n",
       "Freq: Q-DEC, Name: infl, Length: 203, dtype: float64"
      ]
     },
     "execution_count": 125,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.index = index\n",
    "data.infl"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Resampling and Frequency Conversion"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 126,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "d:\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:3: FutureWarning: how in .resample() is deprecated\n",
      "the new syntax is .resample(...).mean()\n",
      "  This is separate from the ipykernel package so we can avoid doing imports until\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "2000-01-31    0.113846\n",
       "2000-02-29   -0.118742\n",
       "2000-03-31    0.174721\n",
       "2000-04-30    0.118978\n",
       "Freq: M, dtype: float64"
      ]
     },
     "execution_count": 126,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "rng = pd.date_range('1/1/2000', periods=100, freq='D')\n",
    "ts = Series(randn(len(rng)), index=rng)\n",
    "ts.resample('M', how='mean')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 127,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "d:\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:1: FutureWarning: how in .resample() is deprecated\n",
      "the new syntax is .resample(...).mean()\n",
      "  \"\"\"Entry point for launching an IPython kernel.\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "2000-01    0.113846\n",
       "2000-02   -0.118742\n",
       "2000-03    0.174721\n",
       "2000-04    0.118978\n",
       "Freq: M, dtype: float64"
      ]
     },
     "execution_count": 127,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts.resample('M', how='mean', kind='period')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Downsampling"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 128,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2000-01-01 00:00:00     0\n",
       "2000-01-01 00:01:00     1\n",
       "2000-01-01 00:02:00     2\n",
       "2000-01-01 00:03:00     3\n",
       "2000-01-01 00:04:00     4\n",
       "2000-01-01 00:05:00     5\n",
       "2000-01-01 00:06:00     6\n",
       "2000-01-01 00:07:00     7\n",
       "2000-01-01 00:08:00     8\n",
       "2000-01-01 00:09:00     9\n",
       "2000-01-01 00:10:00    10\n",
       "2000-01-01 00:11:00    11\n",
       "Freq: T, dtype: int32"
      ]
     },
     "execution_count": 128,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "rng = pd.date_range('1/1/2000', periods=12, freq='T')\n",
    "ts = Series(np.arange(12), index=rng)\n",
    "ts"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 129,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "d:\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:1: FutureWarning: how in .resample() is deprecated\n",
      "the new syntax is .resample(...).sum()\n",
      "  \"\"\"Entry point for launching an IPython kernel.\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "2000-01-01 00:00:00    10\n",
       "2000-01-01 00:05:00    35\n",
       "2000-01-01 00:10:00    21\n",
       "Freq: 5T, dtype: int32"
      ]
     },
     "execution_count": 129,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts.resample('5min', how='sum')\n",
    "# note: output changed (as the default changed from closed='right', label='right' to closed='left', label='left'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 132,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "d:\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:1: FutureWarning: how in .resample() is deprecated\n",
      "the new syntax is .resample(...).sum()\n",
      "  \"\"\"Entry point for launching an IPython kernel.\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "2000-01-01 00:00:00    10\n",
       "2000-01-01 00:05:00    35\n",
       "2000-01-01 00:10:00    21\n",
       "Freq: 5T, dtype: int32"
      ]
     },
     "execution_count": 132,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts.resample('5min', how='sum', closed='left')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 131,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "d:\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:1: FutureWarning: how in .resample() is deprecated\n",
      "the new syntax is .resample(...).sum()\n",
      "  \"\"\"Entry point for launching an IPython kernel.\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "1999-12-31 23:55:00     0\n",
       "2000-01-01 00:00:00    15\n",
       "2000-01-01 00:05:00    40\n",
       "2000-01-01 00:10:00    11\n",
       "Freq: 5T, dtype: int32"
      ]
     },
     "execution_count": 131,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts.resample('5min', how='sum', closed='right')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 131,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "d:\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:1: FutureWarning: how in .resample() is deprecated\n",
      "the new syntax is .resample(...).sum()\n",
      "  \"\"\"Entry point for launching an IPython kernel.\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "2000-01-01 00:00:00    10\n",
       "2000-01-01 00:05:00    35\n",
       "2000-01-01 00:10:00    21\n",
       "Freq: 5T, dtype: int32"
      ]
     },
     "execution_count": 131,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts.resample('5min', how='sum', closed='left', label='left')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 132,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "d:\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:1: FutureWarning: how in .resample() is deprecated\n",
      "the new syntax is .resample(...).sum()\n",
      "  \"\"\"Entry point for launching an IPython kernel.\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "1999-12-31 23:59:59    10\n",
       "2000-01-01 00:04:59    35\n",
       "2000-01-01 00:09:59    21\n",
       "Freq: 5T, dtype: int32"
      ]
     },
     "execution_count": 132,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts.resample('5min', how='sum', loffset='-1s')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 135,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1999-12-31 23:59:59    10\n",
       "2000-01-01 00:04:59    35\n",
       "2000-01-01 00:09:59    21\n",
       "Freq: 5T, dtype: int32"
      ]
     },
     "execution_count": 135,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts.resample('5min', loffset='-1s').sum()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Open-High-Low-Close (OHLC) resampling"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 133,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "d:\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:1: FutureWarning: how in .resample() is deprecated\n",
      "the new syntax is .resample(...).ohlc()\n",
      "  \"\"\"Entry point for launching an IPython kernel.\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2000-01-01 00:00:00</th>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-01 00:05:00</th>\n",
       "      <td>5</td>\n",
       "      <td>9</td>\n",
       "      <td>5</td>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-01 00:10:00</th>\n",
       "      <td>10</td>\n",
       "      <td>11</td>\n",
       "      <td>10</td>\n",
       "      <td>11</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                     open  high  low  close\n",
       "2000-01-01 00:00:00     0     4    0      4\n",
       "2000-01-01 00:05:00     5     9    5      9\n",
       "2000-01-01 00:10:00    10    11   10     11"
      ]
     },
     "execution_count": 133,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts.resample('5min', how='ohlc')\n",
    "# note: output changed because of changed defaults"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Resampling with GroupBy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 134,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1    15\n",
       "2    45\n",
       "3    75\n",
       "4    95\n",
       "dtype: int32"
      ]
     },
     "execution_count": 134,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "rng = pd.date_range('1/1/2000', periods=100, freq='D')\n",
    "ts = Series(np.arange(100), index=rng)\n",
    "ts.groupby(lambda x: x.month).mean()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 135,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    47.5\n",
       "1    48.5\n",
       "2    49.5\n",
       "3    50.5\n",
       "4    51.5\n",
       "5    49.0\n",
       "6    50.0\n",
       "dtype: float64"
      ]
     },
     "execution_count": 135,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts.groupby(lambda x: x.weekday).mean()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Upsampling and interpolation"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 137,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Colorado</th>\n",
       "      <th>Texas</th>\n",
       "      <th>New York</th>\n",
       "      <th>Ohio</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2000-01-05</th>\n",
       "      <td>-1.390167</td>\n",
       "      <td>-0.042483</td>\n",
       "      <td>-1.550881</td>\n",
       "      <td>-0.243932</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-12</th>\n",
       "      <td>0.063020</td>\n",
       "      <td>1.357768</td>\n",
       "      <td>0.756504</td>\n",
       "      <td>1.993291</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "            Colorado     Texas  New York      Ohio\n",
       "2000-01-05 -1.390167 -0.042483 -1.550881 -0.243932\n",
       "2000-01-12  0.063020  1.357768  0.756504  1.993291"
      ]
     },
     "execution_count": 137,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "frame = DataFrame(np.random.randn(2, 4),\n",
    "                  index=pd.date_range('1/1/2000', periods=2, freq='W-WED'),\n",
    "                  columns=['Colorado', 'Texas', 'New York', 'Ohio'])\n",
    "frame"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 137,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DatetimeIndexResampler [freq=<Day>, axis=0, closed=left, label=left, convention=start, base=0]"
      ]
     },
     "execution_count": 137,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_daily = frame.resample('D')\n",
    "df_daily"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 138,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "d:\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:1: FutureWarning: fill_method is deprecated to .resample()\n",
      "the new syntax is .resample(...).ffill()\n",
      "  \"\"\"Entry point for launching an IPython kernel.\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Colorado</th>\n",
       "      <th>Texas</th>\n",
       "      <th>New York</th>\n",
       "      <th>Ohio</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2000-01-05</th>\n",
       "      <td>1.128042</td>\n",
       "      <td>0.926643</td>\n",
       "      <td>0.108381</td>\n",
       "      <td>-0.136499</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-06</th>\n",
       "      <td>1.128042</td>\n",
       "      <td>0.926643</td>\n",
       "      <td>0.108381</td>\n",
       "      <td>-0.136499</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-07</th>\n",
       "      <td>1.128042</td>\n",
       "      <td>0.926643</td>\n",
       "      <td>0.108381</td>\n",
       "      <td>-0.136499</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-08</th>\n",
       "      <td>1.128042</td>\n",
       "      <td>0.926643</td>\n",
       "      <td>0.108381</td>\n",
       "      <td>-0.136499</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-09</th>\n",
       "      <td>1.128042</td>\n",
       "      <td>0.926643</td>\n",
       "      <td>0.108381</td>\n",
       "      <td>-0.136499</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-10</th>\n",
       "      <td>1.128042</td>\n",
       "      <td>0.926643</td>\n",
       "      <td>0.108381</td>\n",
       "      <td>-0.136499</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-11</th>\n",
       "      <td>1.128042</td>\n",
       "      <td>0.926643</td>\n",
       "      <td>0.108381</td>\n",
       "      <td>-0.136499</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-12</th>\n",
       "      <td>1.979043</td>\n",
       "      <td>-1.045755</td>\n",
       "      <td>-1.457502</td>\n",
       "      <td>0.910648</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "            Colorado     Texas  New York      Ohio\n",
       "2000-01-05  1.128042  0.926643  0.108381 -0.136499\n",
       "2000-01-06  1.128042  0.926643  0.108381 -0.136499\n",
       "2000-01-07  1.128042  0.926643  0.108381 -0.136499\n",
       "2000-01-08  1.128042  0.926643  0.108381 -0.136499\n",
       "2000-01-09  1.128042  0.926643  0.108381 -0.136499\n",
       "2000-01-10  1.128042  0.926643  0.108381 -0.136499\n",
       "2000-01-11  1.128042  0.926643  0.108381 -0.136499\n",
       "2000-01-12  1.979043 -1.045755 -1.457502  0.910648"
      ]
     },
     "execution_count": 138,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "frame.resample('D', fill_method='ffill')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 139,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "d:\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:1: FutureWarning: fill_method is deprecated to .resample()\n",
      "the new syntax is .resample(...).ffill(limit=2)\n",
      "  \"\"\"Entry point for launching an IPython kernel.\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Colorado</th>\n",
       "      <th>Texas</th>\n",
       "      <th>New York</th>\n",
       "      <th>Ohio</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2000-01-05</th>\n",
       "      <td>1.128042</td>\n",
       "      <td>0.926643</td>\n",
       "      <td>0.108381</td>\n",
       "      <td>-0.136499</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-06</th>\n",
       "      <td>1.128042</td>\n",
       "      <td>0.926643</td>\n",
       "      <td>0.108381</td>\n",
       "      <td>-0.136499</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-07</th>\n",
       "      <td>1.128042</td>\n",
       "      <td>0.926643</td>\n",
       "      <td>0.108381</td>\n",
       "      <td>-0.136499</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-08</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-09</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-10</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-11</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-12</th>\n",
       "      <td>1.979043</td>\n",
       "      <td>-1.045755</td>\n",
       "      <td>-1.457502</td>\n",
       "      <td>0.910648</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "            Colorado     Texas  New York      Ohio\n",
       "2000-01-05  1.128042  0.926643  0.108381 -0.136499\n",
       "2000-01-06  1.128042  0.926643  0.108381 -0.136499\n",
       "2000-01-07  1.128042  0.926643  0.108381 -0.136499\n",
       "2000-01-08       NaN       NaN       NaN       NaN\n",
       "2000-01-09       NaN       NaN       NaN       NaN\n",
       "2000-01-10       NaN       NaN       NaN       NaN\n",
       "2000-01-11       NaN       NaN       NaN       NaN\n",
       "2000-01-12  1.979043 -1.045755 -1.457502  0.910648"
      ]
     },
     "execution_count": 139,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "frame.resample('D', fill_method='ffill', limit=2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 140,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "d:\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:1: FutureWarning: fill_method is deprecated to .resample()\n",
      "the new syntax is .resample(...).ffill()\n",
      "  \"\"\"Entry point for launching an IPython kernel.\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Colorado</th>\n",
       "      <th>Texas</th>\n",
       "      <th>New York</th>\n",
       "      <th>Ohio</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2000-01-06</th>\n",
       "      <td>1.128042</td>\n",
       "      <td>0.926643</td>\n",
       "      <td>0.108381</td>\n",
       "      <td>-0.136499</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-13</th>\n",
       "      <td>1.979043</td>\n",
       "      <td>-1.045755</td>\n",
       "      <td>-1.457502</td>\n",
       "      <td>0.910648</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "            Colorado     Texas  New York      Ohio\n",
       "2000-01-06  1.128042  0.926643  0.108381 -0.136499\n",
       "2000-01-13  1.979043 -1.045755 -1.457502  0.910648"
      ]
     },
     "execution_count": 140,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "frame.resample('W-THU', fill_method='ffill')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Resampling with periods"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 138,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Colorado</th>\n",
       "      <th>Texas</th>\n",
       "      <th>New York</th>\n",
       "      <th>Ohio</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2000-01</th>\n",
       "      <td>0.535920</td>\n",
       "      <td>-0.255373</td>\n",
       "      <td>0.371472</td>\n",
       "      <td>-0.361550</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-02</th>\n",
       "      <td>-1.580603</td>\n",
       "      <td>-0.072331</td>\n",
       "      <td>0.122752</td>\n",
       "      <td>-0.058610</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-03</th>\n",
       "      <td>-0.138731</td>\n",
       "      <td>0.812544</td>\n",
       "      <td>-0.978779</td>\n",
       "      <td>1.087074</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-04</th>\n",
       "      <td>2.214870</td>\n",
       "      <td>-0.280852</td>\n",
       "      <td>0.367036</td>\n",
       "      <td>0.180315</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-05</th>\n",
       "      <td>1.497833</td>\n",
       "      <td>-0.038354</td>\n",
       "      <td>-1.372628</td>\n",
       "      <td>-0.901398</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         Colorado     Texas  New York      Ohio\n",
       "2000-01  0.535920 -0.255373  0.371472 -0.361550\n",
       "2000-02 -1.580603 -0.072331  0.122752 -0.058610\n",
       "2000-03 -0.138731  0.812544 -0.978779  1.087074\n",
       "2000-04  2.214870 -0.280852  0.367036  0.180315\n",
       "2000-05  1.497833 -0.038354 -1.372628 -0.901398"
      ]
     },
     "execution_count": 138,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "frame = DataFrame(np.random.randn(24, 4),\n",
    "                  index=pd.period_range('1-2000', '12-2001', freq='M'),\n",
    "                  columns=['Colorado', 'Texas', 'New York', 'Ohio'])\n",
    "frame[:5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 139,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "d:\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:1: FutureWarning: how in .resample() is deprecated\n",
      "the new syntax is .resample(...).mean()\n",
      "  \"\"\"Entry point for launching an IPython kernel.\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Colorado</th>\n",
       "      <th>Texas</th>\n",
       "      <th>New York</th>\n",
       "      <th>Ohio</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2000</th>\n",
       "      <td>0.049540</td>\n",
       "      <td>-0.115558</td>\n",
       "      <td>-0.059586</td>\n",
       "      <td>-0.216459</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2001</th>\n",
       "      <td>0.241611</td>\n",
       "      <td>-0.359126</td>\n",
       "      <td>0.209478</td>\n",
       "      <td>0.134561</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      Colorado     Texas  New York      Ohio\n",
       "2000  0.049540 -0.115558 -0.059586 -0.216459\n",
       "2001  0.241611 -0.359126  0.209478  0.134561"
      ]
     },
     "execution_count": 139,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "annual_frame = frame.resample('A-DEC', how='mean')\n",
    "annual_frame"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 140,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "d:\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:2: FutureWarning: fill_method is deprecated to .resample()\n",
      "the new syntax is .resample(...).ffill()\n",
      "  \n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Colorado</th>\n",
       "      <th>Texas</th>\n",
       "      <th>New York</th>\n",
       "      <th>Ohio</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2000Q1</th>\n",
       "      <td>0.049540</td>\n",
       "      <td>-0.115558</td>\n",
       "      <td>-0.059586</td>\n",
       "      <td>-0.216459</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000Q2</th>\n",
       "      <td>0.049540</td>\n",
       "      <td>-0.115558</td>\n",
       "      <td>-0.059586</td>\n",
       "      <td>-0.216459</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000Q3</th>\n",
       "      <td>0.049540</td>\n",
       "      <td>-0.115558</td>\n",
       "      <td>-0.059586</td>\n",
       "      <td>-0.216459</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000Q4</th>\n",
       "      <td>0.049540</td>\n",
       "      <td>-0.115558</td>\n",
       "      <td>-0.059586</td>\n",
       "      <td>-0.216459</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2001Q1</th>\n",
       "      <td>0.241611</td>\n",
       "      <td>-0.359126</td>\n",
       "      <td>0.209478</td>\n",
       "      <td>0.134561</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2001Q2</th>\n",
       "      <td>0.241611</td>\n",
       "      <td>-0.359126</td>\n",
       "      <td>0.209478</td>\n",
       "      <td>0.134561</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2001Q3</th>\n",
       "      <td>0.241611</td>\n",
       "      <td>-0.359126</td>\n",
       "      <td>0.209478</td>\n",
       "      <td>0.134561</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2001Q4</th>\n",
       "      <td>0.241611</td>\n",
       "      <td>-0.359126</td>\n",
       "      <td>0.209478</td>\n",
       "      <td>0.134561</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        Colorado     Texas  New York      Ohio\n",
       "2000Q1  0.049540 -0.115558 -0.059586 -0.216459\n",
       "2000Q2  0.049540 -0.115558 -0.059586 -0.216459\n",
       "2000Q3  0.049540 -0.115558 -0.059586 -0.216459\n",
       "2000Q4  0.049540 -0.115558 -0.059586 -0.216459\n",
       "2001Q1  0.241611 -0.359126  0.209478  0.134561\n",
       "2001Q2  0.241611 -0.359126  0.209478  0.134561\n",
       "2001Q3  0.241611 -0.359126  0.209478  0.134561\n",
       "2001Q4  0.241611 -0.359126  0.209478  0.134561"
      ]
     },
     "execution_count": 140,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Q-DEC: Quarterly, year ending in December\n",
    "annual_frame.resample('Q-DEC', fill_method='ffill')\n",
    "# note: output changed, default value changed from convention='end' to convention='start' + 'start' changed to span-like\n",
    "# also the following cells"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 141,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "d:\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:1: FutureWarning: fill_method is deprecated to .resample()\n",
      "the new syntax is .resample(...).ffill()\n",
      "  \"\"\"Entry point for launching an IPython kernel.\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Colorado</th>\n",
       "      <th>Texas</th>\n",
       "      <th>New York</th>\n",
       "      <th>Ohio</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2000Q1</th>\n",
       "      <td>0.049540</td>\n",
       "      <td>-0.115558</td>\n",
       "      <td>-0.059586</td>\n",
       "      <td>-0.216459</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000Q2</th>\n",
       "      <td>0.049540</td>\n",
       "      <td>-0.115558</td>\n",
       "      <td>-0.059586</td>\n",
       "      <td>-0.216459</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000Q3</th>\n",
       "      <td>0.049540</td>\n",
       "      <td>-0.115558</td>\n",
       "      <td>-0.059586</td>\n",
       "      <td>-0.216459</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000Q4</th>\n",
       "      <td>0.049540</td>\n",
       "      <td>-0.115558</td>\n",
       "      <td>-0.059586</td>\n",
       "      <td>-0.216459</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2001Q1</th>\n",
       "      <td>0.241611</td>\n",
       "      <td>-0.359126</td>\n",
       "      <td>0.209478</td>\n",
       "      <td>0.134561</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2001Q2</th>\n",
       "      <td>0.241611</td>\n",
       "      <td>-0.359126</td>\n",
       "      <td>0.209478</td>\n",
       "      <td>0.134561</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2001Q3</th>\n",
       "      <td>0.241611</td>\n",
       "      <td>-0.359126</td>\n",
       "      <td>0.209478</td>\n",
       "      <td>0.134561</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2001Q4</th>\n",
       "      <td>0.241611</td>\n",
       "      <td>-0.359126</td>\n",
       "      <td>0.209478</td>\n",
       "      <td>0.134561</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        Colorado     Texas  New York      Ohio\n",
       "2000Q1  0.049540 -0.115558 -0.059586 -0.216459\n",
       "2000Q2  0.049540 -0.115558 -0.059586 -0.216459\n",
       "2000Q3  0.049540 -0.115558 -0.059586 -0.216459\n",
       "2000Q4  0.049540 -0.115558 -0.059586 -0.216459\n",
       "2001Q1  0.241611 -0.359126  0.209478  0.134561\n",
       "2001Q2  0.241611 -0.359126  0.209478  0.134561\n",
       "2001Q3  0.241611 -0.359126  0.209478  0.134561\n",
       "2001Q4  0.241611 -0.359126  0.209478  0.134561"
      ]
     },
     "execution_count": 141,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "annual_frame.resample('Q-DEC', fill_method='ffill', convention='start')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 142,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "d:\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:1: FutureWarning: fill_method is deprecated to .resample()\n",
      "the new syntax is .resample(...).ffill()\n",
      "  \"\"\"Entry point for launching an IPython kernel.\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Colorado</th>\n",
       "      <th>Texas</th>\n",
       "      <th>New York</th>\n",
       "      <th>Ohio</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2000Q4</th>\n",
       "      <td>0.049540</td>\n",
       "      <td>-0.115558</td>\n",
       "      <td>-0.059586</td>\n",
       "      <td>-0.216459</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2001Q1</th>\n",
       "      <td>0.049540</td>\n",
       "      <td>-0.115558</td>\n",
       "      <td>-0.059586</td>\n",
       "      <td>-0.216459</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2001Q2</th>\n",
       "      <td>0.049540</td>\n",
       "      <td>-0.115558</td>\n",
       "      <td>-0.059586</td>\n",
       "      <td>-0.216459</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2001Q3</th>\n",
       "      <td>0.049540</td>\n",
       "      <td>-0.115558</td>\n",
       "      <td>-0.059586</td>\n",
       "      <td>-0.216459</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2001Q4</th>\n",
       "      <td>0.241611</td>\n",
       "      <td>-0.359126</td>\n",
       "      <td>0.209478</td>\n",
       "      <td>0.134561</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        Colorado     Texas  New York      Ohio\n",
       "2000Q4  0.049540 -0.115558 -0.059586 -0.216459\n",
       "2001Q1  0.049540 -0.115558 -0.059586 -0.216459\n",
       "2001Q2  0.049540 -0.115558 -0.059586 -0.216459\n",
       "2001Q3  0.049540 -0.115558 -0.059586 -0.216459\n",
       "2001Q4  0.241611 -0.359126  0.209478  0.134561"
      ]
     },
     "execution_count": 142,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "annual_frame.resample('Q-DEC', fill_method='ffill', convention='end')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 145,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "d:\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:1: FutureWarning: fill_method is deprecated to .resample()\n",
      "the new syntax is .resample(...).ffill()\n",
      "  \"\"\"Entry point for launching an IPython kernel.\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Colorado</th>\n",
       "      <th>Texas</th>\n",
       "      <th>New York</th>\n",
       "      <th>Ohio</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2000Q4</th>\n",
       "      <td>0.029827</td>\n",
       "      <td>0.05763</td>\n",
       "      <td>0.160280</td>\n",
       "      <td>0.25112</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2001Q1</th>\n",
       "      <td>0.029827</td>\n",
       "      <td>0.05763</td>\n",
       "      <td>0.160280</td>\n",
       "      <td>0.25112</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2001Q2</th>\n",
       "      <td>0.029827</td>\n",
       "      <td>0.05763</td>\n",
       "      <td>0.160280</td>\n",
       "      <td>0.25112</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2001Q3</th>\n",
       "      <td>0.029827</td>\n",
       "      <td>0.05763</td>\n",
       "      <td>0.160280</td>\n",
       "      <td>0.25112</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2001Q4</th>\n",
       "      <td>0.355663</td>\n",
       "      <td>0.06149</td>\n",
       "      <td>0.007366</td>\n",
       "      <td>0.30308</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002Q1</th>\n",
       "      <td>0.355663</td>\n",
       "      <td>0.06149</td>\n",
       "      <td>0.007366</td>\n",
       "      <td>0.30308</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002Q2</th>\n",
       "      <td>0.355663</td>\n",
       "      <td>0.06149</td>\n",
       "      <td>0.007366</td>\n",
       "      <td>0.30308</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002Q3</th>\n",
       "      <td>0.355663</td>\n",
       "      <td>0.06149</td>\n",
       "      <td>0.007366</td>\n",
       "      <td>0.30308</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        Colorado    Texas  New York     Ohio\n",
       "2000Q4  0.029827  0.05763  0.160280  0.25112\n",
       "2001Q1  0.029827  0.05763  0.160280  0.25112\n",
       "2001Q2  0.029827  0.05763  0.160280  0.25112\n",
       "2001Q3  0.029827  0.05763  0.160280  0.25112\n",
       "2001Q4  0.355663  0.06149  0.007366  0.30308\n",
       "2002Q1  0.355663  0.06149  0.007366  0.30308\n",
       "2002Q2  0.355663  0.06149  0.007366  0.30308\n",
       "2002Q3  0.355663  0.06149  0.007366  0.30308"
      ]
     },
     "execution_count": 145,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "annual_frame.resample('Q-MAR', fill_method='ffill')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Time series plotting"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 146,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "d:\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:3: FutureWarning: fill_method is deprecated to .resample()\n",
      "the new syntax is .resample(...).ffill()\n",
      "  This is separate from the ipykernel package so we can avoid doing imports until\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "DatetimeIndex: 2292 entries, 2003-01-02 to 2011-10-14\n",
      "Freq: B\n",
      "Data columns (total 3 columns):\n",
      "AAPL    2292 non-null float64\n",
      "MSFT    2292 non-null float64\n",
      "XOM     2292 non-null float64\n",
      "dtypes: float64(3)\n",
      "memory usage: 71.6 KB\n"
     ]
    }
   ],
   "source": [
    "close_px_all = pd.read_csv('ch09/stock_px.csv', parse_dates=True, index_col=0)\n",
    "close_px = close_px_all[['AAPL', 'MSFT', 'XOM']]\n",
    "close_px = close_px.resample('B', fill_method='ffill')\n",
    "close_px.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 147,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x9685ef0>"
      ]
     },
     "execution_count": 147,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD8CAYAAAB5Pm/hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAIABJREFUeJzt3Xl8VNX5+PHPSSb7SjaIEAg7iIBAZBFEQangbl2qVsXWFm2xLtW22OpX27pXrdXahaL9uRarVbGCZRFRUQGDIMi+Q0gwITvZJ3N+f9w7k5nMJJlJZjKT4Xm/Xnnl3nPP3HkSyJObc899jtJaI4QQInxFBDsAIYQQgSWJXgghwpwkeiGECHOS6IUQIsxJohdCiDAniV4IIcKcJHohhAhzkuiFECLMSaIXQogwZwl2AAAZGRk6Nzc32GEIIUSPsnHjxuNa68yO+oVEos/NzSU/Pz/YYQghRI+ilDrkTT8ZuhFCiDAniV4IIcKcJHohhAhzkuiFECLMSaIXQogwJ4leCCHCnCR6IYQIc5LohRCiB1r06X6v+0qiF0KIHujFtQe87iuJXggheqDGZu11X0n0QgjRAzU127zuK4leCCF6iOMnGvhs73FAEr0QQoSln7y6ke8vWk9lbRNWGboRQojw8+XBcgBKTtTTKFf0QggRvmoamn3q73WiV0pFKqU2KaXeN/cHKqXWK6X2KKXeUEpFm+0x5v5e83iuTxEJIYRoV0Vdk0/9fbmivwPY4bT/OPBHrfVQoBy42Wy/GSjXWg8B/mj2E0II4aXSEw38YflOmm2ex+GfXL7Lp/N5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o1LqsRCIC621/fN+jHHxcSEQVwGwSWu9X2ttBd7FGLMMdlx2VwPvaK2buhKTn2O7HFintT6htT6BMV4+OQTiQmv9sNb6dK31LIwEu6cb42qLVyvbBSGukHBSJXpz1sILwA6t9dNOh94D5prbczHG4+ztN5ozECYDlVrrIq3197XW/bXWucA9wMta607f5fdXXEqpXkqpGPOcGcBUYHuw48JYdayXUsq+ZuTMEInL7lr8NGzjx9gOA2crpSxmwjkb6PTQjR//j0UqpdLNc44BxgArujGutvh1ZTs/xhUagnVzIBgfwDSMP+e2AJvNjwuAdOBDjCuTD4E0s78Cnse4m78VyPNwzpvo+qwbv8SFMVNjK8Y46lbg5lCIyzw2yzzPVuD/AdEhElcucBSICKX/YxizSP6Okdy3A0+HSFyxZjzbgXXA6d0cVx+Mq/cqoMLcTjaPXYAxO2Yf8JsQiutfGPdZmsz2Lv1cduZDnowVQogwd1IN3QghxMlIEr0QQoQ5SfRCCBHmJNELIUSYk0QvhBBhThK9EEKEOUn0QggR5iTRCyFEmPv/Cgf9ywQMM0oAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "close_px['AAPL'].plot()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 148,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "d:\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:1: DeprecationWarning: \n",
      ".ix is deprecated. Please use\n",
      ".loc for label based indexing or\n",
      ".iloc for positional indexing\n",
      "\n",
      "See the documentation here:\n",
      "http://pandas.pydata.org/pandas-docs/stable/indexing.html#ix-indexer-is-deprecated\n",
      "  \"\"\"Entry point for launching an IPython kernel.\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x9c655f8>"
      ]
     },
     "execution_count": 148,
     "metadata": {},
     "output_type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9xCR+WJzYMwXke7BehEb9feB2KiyiWFp/bfYKL01IhJVrwPHcRwncR59LfB9VR0NTAduFJFTgVuB14M5MF4PlgFmYYMLhmO9Av4AICIXAhOxbmHTgB8EfXIdx3GcFpIQoVfV3aq6PPhdivXd7YcNoHk82O1xGro2Xoz1L1ZV/TfQTWz+jVOBN1W1VlWPYEOXL0hEnh3HcZKVhMfog8Eep2G9MHqr6m6wlwE2RwTYSyB8Vr0dwbqVwCyxiYfysLlxBiQ6z47jOMlEQgdMic3U9yxws6qWiEQc0d3UBlXVeSIyBRvhVoQNCqpNSGYdx3GSlIR59MFQ4GexGepCE1DtlYYpUQuwOSLAPPhwT70/NqMdqvrLYGKy87AXwsZE5dlxHCcZSVSvGwEeBdap6t1hm+YCVwe/rwb+Ebb+qqD3zXRsjo3dYnM89wzSHIdNkxvV/O2O4zgnOwkZMBVMiPQWsBoIjYy8DYvTPw0MxOan/ryqHgheDPdjDa3lwFdUtVBsPu7lwfElwPVh0xg7juM4LcBHxjqO4yQ5PjLWcRwnyXGhdxzHSXJc6B3HcZIcF3rHcZwkx4XecRwnyXGhdxzHSXJc6B3HcZKc/wckDawZTzbn7QAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "close_px.ix['2009'].plot()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 149,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "d:\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:1: DeprecationWarning: \n",
      ".ix is deprecated. Please use\n",
      ".loc for label based indexing or\n",
      ".iloc for positional indexing\n",
      "\n",
      "See the documentation here:\n",
      "http://pandas.pydata.org/pandas-docs/stable/indexing.html#ix-indexer-is-deprecated\n",
      "  \"\"\"Entry point for launching an IPython kernel.\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x9f9a2e8>"
      ]
     },
     "execution_count": 149,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAEfCAYAAABPmQ15AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAIABJREFUeJzsvXl8W3eV9/8+Wmx5k3c7jpesTpM2a5tmga5pgdLSlrK2LAUeSoc+dBiYYeaBWeAFvwcYhmfY2j48lAGm0AJlOnSFtrTpvsRp0sZpEid2YifxbnlfZVvS9/eHrhwnlm3JvrJ05e/79dIr8r3fe+9XusrR0fl+zjmilEKj0Wg0yYst3hPQaDQaTWzRhl6j0WiSHG3oNRqNJsnRhl6j0WiSHG3oNRqNJsnRhl6j0WiSnFkNvYi4RGSviFSLyGER+aaxXUTk2yJSKyI1IvJFY/sVItInIgeMx9dj/SI0Go1GMz2OCMaMAruUUoMi4gReEZEngXVAObBWKRUQkaJJx7yslHpfDOar0Wg0miiZ1dCrYEbVoPGn03go4A7gY0qpgDGuI1aT1Gg0Gs3ciShGLyJ2ETkAdADPKKWqgFXAR0Vkn4g8KSKVkw7ZaYR6nhSRC6Y55+3GsftE5PZ5vxKNRqPRhEWiKYEgIjnAw8BfA3uAbyil/l1EPgB8WSl1qYi4gYAR6rkW+LFSqnKG01JQUKCWL18+5xeh0Wg0i5H9+/d3KqUKZxsXlaEHEJFvAEPAbcA1SqmTIiJAr1IqO8z4k8BWpVTndOfcunWr2rdvX1Tz0Gg0msWOiOxXSm2dbVwkqptCw5NHRNKAq4GjwCPALmPY5UCtMWaJYfgRkW3GNbrm8iI0Go1GM38iUd2UAPeJiJ2g0f6DUuoJEXkFeEBEvkxwsfY2Y/yHgDtExAeMADcrXSJTo9Fo4kYkqpuDwJYw23u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1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "close_px['AAPL'].ix['01-2011':'03-2011'].plot()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 150,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "d:\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:1: FutureWarning: fill_method is deprecated to .resample()\n",
      "the new syntax is .resample(...).ffill()\n",
      "  \"\"\"Entry point for launching an IPython kernel.\n",
      "d:\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:2: DeprecationWarning: \n",
      ".ix is deprecated. Please use\n",
      ".loc for label based indexing or\n",
      ".iloc for positional indexing\n",
      "\n",
      "See the documentation here:\n",
      "http://pandas.pydata.org/pandas-docs/stable/indexing.html#ix-indexer-is-deprecated\n",
      "  \n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0xa276978>"
      ]
     },
     "execution_count": 150,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX4AAAEHCAYAAACp9y31AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAIABJREFUeJzt3Xl8VNX9//HXhyXsECHsEEEIO8gSAcW2Ki7gUrRViyuuoGKr1Vq1P2212j7UumFxLSggoCJqUbQqAlZBARP2RUjYAwESAoEQIMuc3x9z8ZtqINtM7iTzfj4e88jMmXvnfJIT3tzc5VxzziEiItGjht8FiIhI5VLwi4hEGQW/iEiUUfCLiEQZBb+ISJRR8IuIRBkFv4hIlFHwi4hEGQW/iEiUqeV3AQBxcXGuQ4cOfpchIlKlJCcnZzrnmpd1vYgI/g4dOpCUlOR3GSI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wzmV5v1jjCR64zSV4V58kC85nvdRb/wDBmxssD3nBUi7lGOdWQBLBOwcFCM7j0sPbbXAhwZkFawKvu/BPMialFOJxfgs4C4gjeJeqvzjnJlbityNoygYRkaijK3dFRKKMgl9EJMoo+EVEooyCX0Qkyij4RUSijIJfRCTKKPhFRKLM/wfDTr5wE40MMwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "appl_q = close_px['AAPL'].resample('Q-DEC', fill_method='ffill')\n",
    "appl_q.ix['2009':].plot()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Moving window functions"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 151,
   "metadata": {},
   "outputs": [],
   "source": [
    "close_px = close_px.asfreq('B').fillna(method='ffill')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 152,
   "metadata": {},
   "outputs": [
    {
     "ename": "AttributeError",
     "evalue": "module 'pandas' has no attribute 'rolling_mean'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mAttributeError\u001b[0m                            Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-152-f561b2146b39>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[0;32m      1\u001b[0m \u001b[0mclose_px\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mAAPL\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mplot\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 2\u001b[1;33m \u001b[0mpd\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mrolling_mean\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mclose_px\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mAAPL\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m250\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mplot\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;31mAttributeError\u001b[0m: module 'pandas' has no attribute 'rolling_mean'"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD8CAYAAAB5Pm/hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAIABJREFUeJzt3Xl8VNX5+PHPSSb7SjaIEAg7iIBAZBFEQangbl2qVsXWFm2xLtW22OpX27pXrdXahaL9uRarVbGCZRFRUQGDIMi+Q0gwITvZJ3N+f9w7k5nMJJlJZjKT4Xm/Xnnl3nPP3HkSyJObc899jtJaI4QQInxFBDsAIYQQgSWJXgghwpwkeiGECHOS6IUQIsxJohdCiDAniV4IIcKcJHohhAhzkuiFECLMSaIXQogwZwl2AAAZGRk6Nzc32GEIIUSPsnHjxuNa68yO+oVEos/NzSU/Pz/YYQghRI+ilDrkTT8ZuhFCiDAniV4IIcKcJHohhAhzkuiFECLMSaIXQogwJ4leCCHCnCR6IYQIc5LohRCiB1r06X6v+0qiF0KIHujFtQe87iuJXggheqDGZu11X0n0QgjRAzU127zuK4leCCF6iOMnGvhs73FAEr0QQoSln7y6ke8vWk9lbRNWGboRQojw8+XBcgBKTtTTKFf0QggRvmoamn3q73WiV0pFKqU2KaXeN/cHKqXWK6X2KKXeUEpFm+0x5v5e83iuTxEJIYRoV0Vdk0/9fbmivwPY4bT/OPBHrfVQoBy42Wy/GSjXWg8B/mj2E0II4aXSEw38YflO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vbWi1rCnCbUuog8CRwo1LqsRCIC621/fN+jHHxcSEQVwGwSWu9X2ttBd7FGLMMdlx2VwPvaK2buhKTn2O7HFintT6htT6BMV4+OQTiQmv9sNb6dK31LIwEu6cb42qLVyvbBSGukHBSJXpz1sILwA6t9dNOh94D5prbczHG4+ztN5ozECYDlVrrIq3197XW/bXWucA9wMta607f5fdXXEqpXkqpGPOcGcBUYHuw48JYdayXUsq+ZuTMEInL7lr8NGzjx9gOA2crpSxmwjkb6PTQjR//j0UqpdLNc44BxgArujGutvh1ZTs/xhUagnVzIBgfwDSMP+e2AJvNjwuAdOBDjCuTD4E0s78Cnse4m78VyPNwzpvo+qwbv8SFMVNjK8Y46lbg5lCIyzw2yzzPVuD/AdEhElcucBSICKX/YxizSP6Okdy3A0+HSFyxZjzbgXXA6d0cVx+Mq/cqoMLcTjaPXYAxO2Yf8JsQiutfGPdZmsz2Lv1cduZDnowVQogwd1IN3QghxMlIEr0QQoQ5SfRCCBHmJNELIUSYk0QvhBBhThK9EEKEOUn0QggR5iTRCyFEmPv/Cgf9ywQMM0oAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "close_px.AAPL.plot()\n",
    "pd.rolling_mean(close_px.AAPL, 250).plot()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "plt.figure()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "appl_std250 = pd.rolling_std(close_px.AAPL, 250, min_periods=10)\n",
    "appl_std250[5:12]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "appl_std250.plot()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Define expanding mean in terms of rolling_mean\n",
    "expanding_mean = lambda x: rolling_mean(x, len(x), min_periods=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "pd.rolling_mean(close_px, 60).plot(logy=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "plt.close('all')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Exponentially-weighted functions"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "fig, axes = plt.subplots(nrows=2, ncols=1, sharex=True, sharey=True,\n",
    "                         figsize=(12, 7))\n",
    "\n",
    "aapl_px = close_px.AAPL['2005':'2009']\n",
    "\n",
    "ma60 = pd.rolling_mean(aapl_px, 60, min_periods=50)\n",
    "ewma60 = pd.ewma(aapl_px, span=60)\n",
    "\n",
    "aapl_px.plot(style='k-', ax=axes[0])\n",
    "ma60.plot(style='k--', ax=axes[0])\n",
    "aapl_px.plot(style='k-', ax=axes[1])\n",
    "ewma60.plot(style='k--', ax=axes[1])\n",
    "axes[0].set_title('Simple MA')\n",
    "axes[1].set_title('Exponentially-weighted MA')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Binary moving window functions"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "close_px\n",
    "spx_px = close_px_all['SPX']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "spx_rets = spx_px / spx_px.shift(1) - 1\n",
    "returns = close_px.pct_change()\n",
    "corr = pd.rolling_corr(returns.AAPL, spx_rets, 125, min_periods=100)\n",
    "corr.plot()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "corr = pd.rolling_corr(returns, spx_rets, 125, min_periods=100)\n",
    "corr.plot()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### User-defined moving window functions"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from scipy.stats import percentileofscore\n",
    "score_at_2percent = lambda x: percentileofscore(x, 0.02)\n",
    "result = pd.rolling_apply(returns.AAPL, 250, score_at_2percent)\n",
    "result.plot()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Performance and Memory Usage Notes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "rng = pd.date_range('1/1/2000', periods=10000000, freq='10ms')\n",
    "ts = Series(np.random.randn(len(rng)), index=rng)\n",
    "ts"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "ts.resample('15min', how='ohlc').info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "%timeit ts.resample('15min', how='ohlc')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "rng = pd.date_range('1/1/2000', periods=10000000, freq='1s')\n",
    "ts = Series(np.random.randn(len(rng)), index=rng)\n",
    "%timeit ts.resample('15s', how='ohlc')"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {
    "height": "calc(100% - 180px)",
    "left": "10px",
    "top": "150px",
    "width": "384px"
   },
   "toc_section_display": true,
   "toc_window_display": true
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
